<?php
   require("Smarty.class.php");
   require("boxer.class.php");

   $smarty = new Smarty;

   $smarty->caching = 1;

   try {

      // If the template not already cached, retrieve the appropriate information.
      if (!is_cached("boxerbio.tpl", $_GET['boxerid'])) {
         $bx = new boxer();

         if (! $bx->retrieveBoxer($_GET['boxerid']) )
              throw new Exception("Boxer not found.");

         // Create the appropriate Smarty variables
         $smarty->assign("name", $bx->getName());
         $smarty->assign("bio", $bx->getBio());
      }

      /* Render the template, caching it and assigning it the name 
      * represented by $_GET['boxerid']. If already cached, then
      * retrieve that cached template
      */
      $smarty->display("boxerbio.tpl", $_GET['boxerid']);

   } catch (Exception $e) {
      echo $e->getMessage();
   }
?>